﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations.Schema;

namespace WaterRevenueMS.Componnent.Data.Mapping.Customer
{
    partial class MeterInfoMap
    {
        partial void MeterInfoMapAppend()
        {
            this.HasKey(t => t.Id);
            this.Property(t => t.Zhong_JDZ)
                .HasMaxLength(24);
            this.Property(t => t.Ji_ZQDZ)
                .HasMaxLength(24);
            this.Property(t => t.Shou_CQBH)
                .HasMaxLength(24);
            this.Property(t => t.Yi_BMC)
                .HasMaxLength(16);
            this.Property(t => t.Yi_BDZ)
                .HasMaxLength(24);
            this.Property(t => t.Yi_BBH)
                .HasMaxLength(16);
            this.Property(t => t.Qian_FH)
                .HasMaxLength(256);
            this.Property(t => t.Yi_BZT)
                .HasMaxLength(16);
            this.Property(t => t.Tong_XZT)
                .HasMaxLength(16);
            this.Property(t => t.Fa_MZT)
                .HasMaxLength(16);
            this.Property(t => t.Shu_JZT)
                .HasMaxLength(16);
            this.ToTable("Bsc_MeterInfo");
            this.Property(t => t.Id).HasColumnName("Meter_ID")
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);



            this.HasOptional(t => t.MeterBook).WithMany(d => d.MeterInfo).HasForeignKey(t => t.Biao_CSZ_No);//表册ID
            this.HasOptional(t => t.Customer).WithMany(d => d.MeterInfo).HasForeignKey(t => t.Yong_HSZ_No);//用户ID
            this.HasOptional(t => t.RelayType).WithMany(d => d.MeterInfo).HasForeignKey(t => t.Zhong_JLX_No);//中继ID
            this.HasOptional(t => t.Manufacturer).WithMany(d => d.MeterInfo).HasForeignKey(t => t.Shui_BCS_No);//水表厂商
            this.HasOptional(t => t.ConcentratorType).WithMany(d => d.MeterInfo).HasForeignKey(t => t.Ji_ZQLX_No);//集中器
            this.HasOptional(t => t.WaterCaliber).WithMany(d => d.MeterInfo).HasForeignKey(t => t.Shui_BKJ_No);//口径
            this.HasOptional(t => t.WayOfCharge).WithMany(d => d.MeterInfo).HasForeignKey(t => t.Shou_FFS_No);//收费代码
            this.HasOptional(t => t.KindOfWaterUse).WithMany(d => d.MeterInfo).HasForeignKey(t => t.Yong_SLX_No);//用水类型
            this.HasOptional(t => t.MeterType).WithMany(d => d.MeterInfo).HasForeignKey(t => t.Yi_BLX_No);//仪表类型
            this.HasOptional(t => t.HandSetType).WithMany(d => d.MeterInfo).HasForeignKey(t => t.Shou_CQLX_No);//手抄表
            this.HasOptional(t => t.TaskTemplete).WithMany(d => d.MeterInfos).HasForeignKey(t => t.RMeter_No); //抄表任务




        }
    }
}
